home *** CD-ROM | disk | FTP | other *** search
- on readprefs
- global gType, gStuMethod
- if gType = #MAC then
- set fname to the pathName & "Rosetta Prefs"
- else
- set fname to the pathName & "rosetta.prf"
- end if
- set gStuMethod to [:]
- set prefFile to FileIO(mnew, "read", fname)
- if objectp(prefFile) then
- set prefLine to prefFile(mReadLine)
- set acrobatPath to prefFile(mReadLine)
- put prefLine
- put acrobatPath
- if voidp(acrobatPath) then
- set acrobatPath to EMPTY
- end if
- prefFile(mdispose)
- set gStuMethod to value(prefLine)
- if listp(gStuMethod) then
- setaProp(gStuMethod, #acrobatPath, acrobatPath)
- set v to getaProp(gStuMethod, #volume)
- set n to getaProp(gStuMethod, #no_sound)
- set y to getaProp(gStuMethod, #yes_sound)
- set i to getaProp(gStuMethod, #icons)
- set acrobatPath to getaProp(gStuMethod, #acrobatPath)
- if voidp(v) or voidp(y) or voidp(n) or voidp(i) or voidp(acrobatPath) then
- set gStuMethod to [:]
- else
- if (v < 1) or (v > 7) or ((i <> #check) and (i <> #smiley)) or (y < 1) or (y > 8) or (n < 1) or (n > 8) then
- set gStuMethod to [:]
- end if
- if not stringp(acrobatPath) then
- set gStuMethod to [:]
- end if
- if acrobatPath = EMPTY then
- set gStuMethod to [:]
- end if
- end if
- end if
- end if
- if gStuMethod = [:] then
- set prefLine to "[#yes_sound: 1, #no_sound: 1, #icons: #Check, #volume: 4]" & numToChar(10) & numToChar(13)
- set acrobatPath to "C:\ACROREAD\ACROREAD.EXE"
- set gStuMethod to value(prefLine)
- set prefFile to FileIO(mnew, "write", fname)
- if objectp(prefFile) then
- prefFile(mWriteString, prefLine)
- prefFile(mWriteString, acrobatPath)
- if gType = #MAC then
- prefFile(mSetFinderInfo, "PREF", "FLT0")
- end if
- prefFile(mdispose)
- end if
- setaProp(gStuMethod, #acrobatPath, acrobatPath)
- end if
- registerVolume(getaProp(gStuMethod, #volume))
- end
-
- on savePrefs
- global gType, gStuMethod
- set prefs to [:]
- setaProp(prefs, #yes_sound, getaProp(gStuMethod, #yes_sound))
- setaProp(prefs, #no_sound, getaProp(gStuMethod, #no_sound))
- setaProp(prefs, #icons, getaProp(gStuMethod, #icons))
- setaProp(prefs, #volume, getaProp(gStuMethod, #volume))
- if gType = #MAC then
- set fname to the pathName & "Rosetta Prefs"
- else
- set fname to the pathName & "rosetta.prf"
- end if
- set prefFile to FileIO(mnew, "write", fname)
- if objectp(prefFile) then
- set prefString to string(prefs) & numToChar(10) & numToChar(13)
- prefFile(mWriteString, prefString)
- prefFile(mWriteString, getaProp(gStuMethod, #acrobatPath))
- if gType = #MAC then
- prefFile(mSetFinderInfo, "PREF", "FLT0")
- end if
- prefFile(mdispose)
- end if
- end
-